<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>电子地磅测试页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="application/javascript">
        var t;
        /*     function startComm(){
         document.applets["myapp"].start();
         process();
         }*/
        function process(){
            var ready = document.applets["myapp"].readystate;
            if(ready=="complete"){
                var msg = document.applets["myapp"].getPortData();
                alert(msg);
                document.getElementById("t").value=msg;
            }
            t=setTimeout('process()',35);
        }
        function closeComm(){
            clearTimeout(t);
        }
        function readPort(){
            var msg = document.applets["myapp"].getPortData();
            document.getElementById("t").value=msg.trim();
        }
    </script>
</head>
<body onload="process();">
<APPLET CODEBASE="."
        CODE="com.tydic.applet.DashboardApplet.class" ARCHIVE="deviceApplet.jar,RXTXcomm.jar"
        WIDTH="400" HEIGHT="300" name="myapp">
</APPLET>
<!-- <input type="button" value="确定" id="x" onclick="startComm()"> -->
<input type="button" value="取数" id="s1" onclick="readPort()">
<input type="button" value="关闭" id="s" onclick="closeComm()">
<input id="t" type="text" value="" >
</body>
</html>